package com.fish.anne.model;

import com.fish.anne.model.BaseObject;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

import java.io.Serializable;

@Entity
@Table(name="member_coupon" )
public class MemberCoupon extends BaseObject implements Serializable {
    private Long memberCouponId;
    private Long couponId;
    private Long createTime;
    private String mcCode;
    private boolean mcEnabled;
    private boolean mcOnline;
    private byte mcSource;
    private boolean mcUsed;
    private Long memberId;
    private Long usedOrder;
    private Long usedTime;

    @Id   @GeneratedValue(strategy = GenerationType.AUTO)    
    public Long getMemberCouponId() {
        return this.memberCouponId;
    }
    
    public void setMemberCouponId(Long memberCouponId) {
        this.memberCouponId = memberCouponId;
    }
    
    @Column(name="coupon_id", nullable=false)
    public Long getCouponId() {
        return this.couponId;
    }
    
    public void setCouponId(Long couponId) {
        this.couponId = couponId;
    }
    
    @Column(name="create_time", nullable=false)
    public Long getCreateTime() {
        return this.createTime;
    }
    
    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }
    
    @Column(name="mc_code", nullable=false)
    public String getMcCode() {
        return this.mcCode;
    }
    
    public void setMcCode(String mcCode) {
        this.mcCode = mcCode;
    }
    
    @Column(name="mc_enabled", nullable=false)
    public boolean isMcEnabled() {
        return this.mcEnabled;
    }
    
    public void setMcEnabled(boolean mcEnabled) {
        this.mcEnabled = mcEnabled;
    }
    
    @Column(name="mc_online", nullable=false)
    public boolean isMcOnline() {
        return this.mcOnline;
    }
    
    public void setMcOnline(boolean mcOnline) {
        this.mcOnline = mcOnline;
    }
    
    @Column(name="mc_source", nullable=false)
    public byte getMcSource() {
        return this.mcSource;
    }
    
    public void setMcSource(byte mcSource) {
        this.mcSource = mcSource;
    }
    
    @Column(name="mc_used", nullable=false)
    public boolean isMcUsed() {
        return this.mcUsed;
    }
    
    public void setMcUsed(boolean mcUsed) {
        this.mcUsed = mcUsed;
    }
    
    @Column(name="member_id", nullable=false)
    public Long getMemberId() {
        return this.memberId;
    }
    
    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }
    
    @Column(name="used_order", nullable=false)
    public Long getUsedOrder() {
        return this.usedOrder;
    }
    
    public void setUsedOrder(Long usedOrder) {
        this.usedOrder = usedOrder;
    }
    
    @Column(name="used_time", nullable=false)
    public Long getUsedTime() {
        return this.usedTime;
    }
    
    public void setUsedTime(Long usedTime) {
        this.usedTime = usedTime;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MemberCoupon pojo = (MemberCoupon) o;

        if (couponId != null ? !couponId.equals(pojo.couponId) : pojo.couponId != null) return false;
        if (createTime != null ? !createTime.equals(pojo.createTime) : pojo.createTime != null) return false;
        if (mcCode != null ? !mcCode.equals(pojo.mcCode) : pojo.mcCode != null) return false;
        if (mcEnabled != pojo.mcEnabled) return false;
        if (mcOnline != pojo.mcOnline) return false;
         if (mcUsed != pojo.mcUsed) return false;
        if (memberId != null ? !memberId.equals(pojo.memberId) : pojo.memberId != null) return false;
        if (usedOrder != null ? !usedOrder.equals(pojo.usedOrder) : pojo.usedOrder != null) return false;
        if (usedTime != null ? !usedTime.equals(pojo.usedTime) : pojo.usedTime != null) return false;

        return true;
    }

    public int hashCode() {
        int result = 0;
        result = (couponId != null ? couponId.hashCode() : 0);
        result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
        result = 31 * result + (mcCode != null ? mcCode.hashCode() : 0);
        result = 31 * result + (mcEnabled ? 1 : 0);
        result = 31 * result + (mcOnline ? 1 : 0);
         result = 31 * result + (mcUsed ? 1 : 0);
        result = 31 * result + (memberId != null ? memberId.hashCode() : 0);
        result = 31 * result + (usedOrder != null ? usedOrder.hashCode() : 0);
        result = 31 * result + (usedTime != null ? usedTime.hashCode() : 0);

        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("memberCouponId").append("='").append(getMemberCouponId()).append("', ");
        sb.append("couponId").append("='").append(getCouponId()).append("', ");
        sb.append("createTime").append("='").append(getCreateTime()).append("', ");
        sb.append("mcCode").append("='").append(getMcCode()).append("', ");
        sb.append("mcEnabled").append("='").append(isMcEnabled()).append("', ");
        sb.append("mcOnline").append("='").append(isMcOnline()).append("', ");
        sb.append("mcSource").append("='").append(getMcSource()).append("', ");
        sb.append("mcUsed").append("='").append(isMcUsed()).append("', ");
        sb.append("memberId").append("='").append(getMemberId()).append("', ");
        sb.append("usedOrder").append("='").append(getUsedOrder()).append("', ");
        sb.append("usedTime").append("='").append(getUsedTime()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
